Naanou.LookupService
Class PartitionDetect

Detects if the node is running in a partitioned network

Field Summary
Naanou.LookupService.Node node
Naanou.LookupService.PeerDiscovery peerDiscovery
bool running
System.Threading.Thread thread

Constructor Summary
PartitionDetect(Naanou.LookupService.Node node)
         Constructor

Property Summary
bool IsRunning
         Is process running?

Method Summary
void OnDiscoveryComplete(object sender, System.EventArgs args)
         Discovery has finished
void Start()
         Starts (sync)
void StartAsync()
         Starts (async)
void Stop()
         Stops process
void TakeAction()
         Use results to work out if our node is in a smaller network than what else is out there If we find a net with same # of nodes, roll a dice to see if we'll join 'em (to prevent both sides effectively swapping)

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString

Event Summary
System.EventHandler DetectionComplete
         Detection is completed


Field Detail

node

private Naanou.LookupService.Node node


peerDiscovery

private Naanou.LookupService.PeerDiscovery peerDiscovery


running

private bool running


thread

private System.Threading.Thread thread

Constructor Detail

PartitionDetect

public PartitionDetect(Naanou.LookupService.Node node)

Constructor

Parameters:
node -
Property Detail

IsRunning

public bool IsRunning

Is process running?

Method Detail

OnDiscoveryComplete

private void OnDiscoveryComplete(object sender,
                                 System.EventArgs args)

Discovery has finished

Parameters:
sender -
args -

Start

public void Start()

Starts (sync)


StartAsync

public void StartAsync()

Starts (async)


Stop

public void Stop()

Stops process


TakeAction

public void TakeAction()

Use results to work out if our node is in a smaller network than what else is out there If we find a net with same # of nodes, roll a dice to see if we'll join 'em (to prevent both sides effectively swapping)

Event Detail

DetectionComplete

public System.EventHandler DetectionComplete

Detection is completed